{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>简历管理 - 大学生就业管理系统</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background: #f0f2f5;
            min-height: 100vh;
        }

        /* 导航栏样式 */
        .navbar {
            background: #1e3c72;
            padding: 15px 50px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .logo {
            font-size: 24px;
            font-weight: bold;
            color: white;
            text-decoration: none;
        }

        .nav-buttons {
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .btn {
            padding: 8px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .btn-login {
            background: transparent;
            border: 1px solid white;
            color: white;
        }

        .btn-login:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .btn-register {
            background: white;
            color: #1e3c72;
        }

        .btn-register:hover {
            background: #f8f9fa;
            transform: translateY(-1px);
        }

        .btn-primary {
            background: #1e3c72;
            color: white;
        }

        .btn-primary:hover {
            background: #2a4d8f;
        }

        .btn-success {
            background: #28a745;
            color: white;
        }

        .btn-success:hover {
            background: #218838;
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 15px;
            cursor: pointer;
            position: relative;
        }

        .user-avatar {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #1e3c72;
            font-weight: bold;
            font-size: 16px;
        }

        .user-name {
            color: white;
            font-size: 16px;
            margin-left: 5px;
            font-weight: 500;
        }

        .dropdown-menu {
            position: absolute;
            top: 100%;
            right: 0;
            background: white;
            border-radius: 4px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            margin-top: 10px;
            min-width: 150px;
            display: none;
            z-index: 1000;
        }

        .user-profile:hover .dropdown-menu {
            display: block;
        }

        .dropdown-menu a {
            display: block;
            padding: 10px 15px;
            color: #333;
            text-decoration: none;
            transition: background 0.3s;
        }

        .dropdown-menu a:hover {
            background: #f8f9fa;
        }

        /* 主要内容区域 */
        .main-content {
            max-width: 1200px;
            margin: 40px auto;
            padding: 0 20px;
        }

        .page-header {
            margin-bottom: 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .page-title {
            color: #1e3c72;
            font-size: 24px;
        }

        .resume-dashboard {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 30px;
        }

        .sidebar {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }

        .menu-item {
            display: block;
            padding: 12px 15px;
            margin-bottom: 5px;
            border-radius: 4px;
            color: #333;
            text-decoration: none;
            transition: all 0.3s;
        }

        .menu-item:hover, .menu-item.active {
            background: #eef2fd;
            color: #1e3c72;
        }

        .menu-item i {
            margin-right: 10px;
            width: 20px;
            text-align: center;
        }

        .content-area {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 30px;
        }

        .resume-header {
            display: flex;
            justify-content: space-between;
            padding-bottom: 20px;
            border-bottom: 1px solid #eee;
            margin-bottom: 20px;
        }

        .section {
            margin-bottom: 25px;
        }

        .section-title {
            color: #1e3c72;
            margin-bottom: 15px;
            font-size: 18px;
            display: flex;
            align-items: center;
        }

        .section-title i {
            margin-right: 10px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
        }

        .form-control {
            width: 100%;
            padding: 10px 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .form-control:focus {
            outline: none;
            border-color: #1e3c72;
        }

        .resume-preview {
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 30px;
            position: relative;
        }

        .action-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
            margin-top: 20px;
        }

        .progress-bar {
            height: 8px;
            background: #eee;
            border-radius: 4px;
            margin-top: 10px;
            overflow: hidden;
        }

        .progress-value {
            height: 100%;
            background: #1e3c72;
            border-radius: 4px;
            width: 75%;
        }

        .progress-text {
            font-size: 14px;
            color: #666;
            margin-top: 5px;
            text-align: right;
        }

        .experience-item {
            padding: 15px;
            border: 1px solid #eee;
            border-radius: 4px;
            margin-bottom: 15px;
        }

        .experience-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
        }

        .experience-company {
            font-weight: 500;
        }

        .experience-period {
            color: #666;
            font-size: 14px;
        }

        .add-section {
            display: inline-flex;
            align-items: center;
            color: #1e3c72;
            text-decoration: none;
            font-weight: 500;
            margin-top: 10px;
        }

        .add-section i {
            margin-right: 5px;
        }

        @media (max-width: 768px) {
            .navbar {
                padding: 15px 20px;
            }

            .resume-dashboard {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
<nav class="navbar">
    <div class="left-nav">
        <a href="{% url 'author:student_index' %}" class="logo">大学生就业管理系统</a>
    </div>

    <div class="nav-buttons">
        {% if user.is_authenticated %}
            <div class="user-profile">
                <div class="user-avatar">
                    <img src="{% static 'image/xiaoqin.png' %}" alt="">
                    {{ user.username|first|upper }}
                </div>
                <span class="user-name">{{ user.username }}</span>
                <div class="dropdown-menu">
                    <a href="{% url 'author:logout' %}" style="color: #dc3545;"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
                </div>
            </div>
        {% else %}
            <a href="{% url 'author:login' %}" class="btn btn-login">登录</a>
            <a href="{% url 'author:register' %}" class="btn btn-register">注册</a>
        {% endif %}
    </div>
</nav>

<div class="main-content">
    <div class="page-header">
        <h1 class="page-title"><i class="fas fa-file-alt"></i> 简历管理</h1>
    </div>

    <div class="resume-dashboard">
        <div class="sidebar">
            <a href="{% url 'job:base_information' %}"
               class="menu-item {% if request.resolver_match.url_name == 'base_information' %}active{% endif %}">
                <i class="fas fa-id-card"></i> 基本信息
            </a>
            <a href="{% url 'job:education_experience' %}"
               class="menu-item {% if request.resolver_match.url_name == 'education_experience' %}active{% endif %}">
                <i class="fas fa-graduation-cap"></i> 教育经历
            </a>
            <a href="{% url 'job:work_experience' %}"
               class="menu-item {% if request.resolver_match.url_name == 'work_experience' %}active{% endif %}">
                <i class="fas fa-briefcase"></i> 工作经验
            </a>
            <a href="{% url 'job:awards' %}"
               class="menu-item {% if request.resolver_match.url_name == 'awards' %}active{% endif %}">
                <i class="fas fa-trophy"></i> 获奖情况
            </a>
            <a href="{% url 'job:professional_skills' %}"
               class="menu-item {% if request.resolver_match.url_name == 'professional_skills' %}active{% endif %}">
                <i class="fas fa-cogs"></i> 专业技能
            </a>
            <a href="{% url 'job:projects_experience' %}"
               class="menu-item {% if request.resolver_match.url_name == 'projects_experience' %}active{% endif %}">
                <i class="fas fa-tasks"></i> 项目经历
            </a>
            <a href="{% url 'job:job_intentions' %}"
               class="menu-item {% if request.resolver_match.url_name == 'job_intentions' %}active{% endif %}">
                <i class="fas fa-user-tie"></i> 求职意向
            </a>
            <a href="{% url 'job:resume_preview' %}"
               class="menu-item {% if request.resolver_match.url_name == 'resume_preview' %}active{% endif %}">
                <i class="fas fa-eye"></i> 预览简历
            </a>
        </div>

        <div class="content-area">

            <div class="section">
                {% block content %}
                    <div class="container">
                        <h2>基本信息</h2>

                        <form id="base-info-form" method="post">
                            {% csrf_token %}
                            <div class="form-group">
                                <label for="name">姓名</label>
                                <input type="text" class="form-control" id="name" name="name" required
                                       value="{{ form.name|default_if_none:'' }}">
                            </div>

                            <div class="form-group">
                                <label for="gender">性别</label>
                                <select class="form-control" id="gender" name="gender" required>
                                    <option value="">请选择</option>
                                    <option value="男" {% if form.gender == "男" %}selected{% endif %}>男</option>
                                    <option value="女" {% if form.gender == "女" %}selected{% endif %}>女</option>
                                </select>
                            </div>

                            <div class="form-group">
                                <label for="birthday">出生日期</label>
                                <input type="date" class="form-control" id="birthday" name="birthday" required
                                       value="{{ form.birthday|default_if_none:'' }}">
                            </div>

                            <div class="form-group">
                                <label for="phone">联系电话</label>
                                <input type="text" class="form-control" id="phone" name="phone" required
                                       value="{{ form.phone|default_if_none:'' }}">
                            </div>

                            <div class="form-group">
                                <label for="email">电子邮箱</label>
                                <input type="email" class="form-control" id="email" name="email" required
                                       value="{{ form.email|default_if_none:'' }}">
                            </div>

                            <div class="form-group">
                                <label for="location">所在地区</label>
                                <input type="text" class="form-control" id="location" name="location" required
                                       value="{{ form.location|default_if_none:'' }}">
                            </div>

                            <div class="form-group">
                                <label for="personal_description">个人描述</label>
                                <textarea class="form-control" id="personal_description" name="personal_description"
                                          rows="4">{{ form.personal_description|default_if_none:'' }}</textarea>
                            </div>

                            <div class="action-buttons">
                                <button type="submit" class="btn btn-primary" id="baseinformation">保存</button>
                            </div>
                        </form>
                    </div>

                    <!-- 引入SweetAlert2库用于美观的弹窗 -->
                    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
                    <script src="{% static 'js/base_information.js' %}"></script>
                    <!-- 引入自定义JS -->
                {% endblock %}
            </div>


        </div>
    </div>
</div>
</body>
</html>